package com.lottery.pay.Model.weixin;

import org.apache.commons.lang.RandomStringUtils;

/**
 * 发起支付所需参数
 */
public class PaymentParam {
	private String appId = "";// 公众账号ID
	private int timeStamp = (int) (System.currentTimeMillis() / 1000);// 取当前时间，并精确到秒
	private String nonceStr = RandomStringUtils.randomAlphanumeric(20);// 生成随机字符串
	private String packageValue = "prepay_id=PREPAY_ID";// 订单详情扩展字符串
	private String partnerId  = "";
	private String prepayId = "";
	private String signType = "MD5";// 签名方式
	private String paySign = "";// 签名
	private String codeUrl = "";// NATIVE时有返回
	private String mwebUrl = "";// MWEB时有返回

	public PaymentParam() {
	}


	public PaymentParam(String appId,String prepay_id , String code_url , String mweb_url) {
		this.appId = appId;
		this.packageValue = this.packageValue.replace("PREPAY_ID", prepay_id);
		this.codeUrl = code_url;
		this.mwebUrl = mweb_url;
	}

	public PaymentParam(String appId,String partnerId, String prepay_id ,String packageValue, String code_url , String mweb_url) {
		this.appId = appId;
		this.partnerId = partnerId;
		this.prepayId = prepay_id;
		this.packageValue=packageValue;
		this.codeUrl = code_url;
		this.mwebUrl = mweb_url;
	}

	public String getAppId() {
		return appId;
	}

	public int getTimeStamp() {
		return timeStamp;
	}

	public String getNonceStr() {
		return nonceStr;
	}

	public String getPackageValue() {
		return packageValue;
	}

	public String getSignType() {
		return signType;
	}

	public String getPaySign() {
		return paySign;
	}

	public void setPaySign(String paySign) {
		this.paySign = paySign;
	}

	public String getCodeUrl() {
		return codeUrl;
	}

	public void setCodeUrl(String codeUrl) {
		this.codeUrl = codeUrl;
	}

	public String getMwebUrl() {
		return mwebUrl;
	}

	public void setMwebUrl(String mwebUrl) {
		this.mwebUrl = mwebUrl;
	}

	public String getPartnerId() {
		return partnerId;
	}

	public void setPartnerId(String partnerId) {
		this.partnerId = partnerId;
	}

	public String getPrepayId() {
		return prepayId;
	}

	public void setPrepayId(String prepayId) {
		this.prepayId = prepayId;
	}
}
